//
//  MSguideView.m
//  百思不得姐
//
//  Created by 马赛亮 on 16/5/6.
//  Copyright © 2016年 马赛亮. All rights reserved.
//

#import "MSguideView.h"
@interface MSguideView()


@end
@implementation MSguideView
#pragma mark - 初始化方法
+ (void)showGuideView
{
    NSString *key = @"CFBundleShortVersionString";
    // 获取当前的版本号
    NSString *currVission = [NSBundle mainBundle].infoDictionary[key];
    // 获取沙盒中的版本号
    NSString *sandboxverssion = [[NSUserDefaults standardUserDefaults] stringForKey:key];
    
    if (![currVission isEqualToString:sandboxverssion]) {
        UIWindow *window = [UIApplication sharedApplication].keyWindow;
        MSguideView *guideView = [MSguideView initGuideView];
        
        guideView.frame = window.bounds;
        [window addSubview:guideView];
        // 将版本号保存
        [[NSUserDefaults standardUserDefaults] setValue:currVission forKey:key];
        [[NSUserDefaults standardUserDefaults] synchronize];
    }
}
+ (instancetype)initGuideView
{
    return [[[NSBundle mainBundle] loadNibNamed:NSStringFromClass(self) owner:nil options:nil]lastObject];
}



@end
